package com.tec.cloud.notice.web;

import com.tec.cloud.notice.constant.ConfigType;
import com.tec.cloud.notice.service.ConfigService;
import com.tec.cloud.notice.vo.ConfigVO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CertificationNoticeController {

    ConfigService configService;

    private ConfigType certificationNotice = ConfigType.CERTIFICATION_NOTICE;

    public CertificationNoticeController(ConfigService configService) {
        this.configService = configService;
    }

    @PostMapping
    public void add(@RequestBody ConfigVO config) {
        config.setType(certificationNotice.getCode());
        configService.addConfig(config);
    }
}
